1 : <?php
2 : /*--------------------------------------------------------------------------+
3 : This file is part of eStudy.
4 : suchmaschine/classes/class.pluginhtm.inc.php
5 : - Modulgruppe: Suche
6 : - Beschreibung: In dieser Datei wird die Klasse PluginHtm implementiert.
7 : - Version: 0.1 01/08/08
8 : - Autor(en): Jörg Rieger
9 : +---------------------------------------------------------------------------+
10 : This program is free software; you can redistribute it and/or
11 : modify it under the terms of the GNU General Public License
12 : as published by the Free Software Foundation; either version 2
13 : of the License, or any later version.
14 : +---------------------------------------------------------------------------+
15 : This program is distributed in the hope that it will be useful,
16 : but WITHOUT ANY WARRANTY; without even the implied warranty of
17 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 : GNU General Public License for more details.
19 : You should have received a copy of the GNU General Public License
20 : along with this program; if not, write to the Free Software
21 : Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 : +--------------------------------------------------------------------------*/
23 : /**
24 : * Path to Root falls nicht gesetzt
25 : */
26 1 : if (!defined('PATH_TO_ROOT')) {
27 0 : define("PATH_TO_ROOT", "../../");
28 :
29 0 : require_once('class.iindexer.inc.php');
30 0 : require_once('class.indexer.inc.php');
31 0 : }
32 :
33 : /**
34 : * Klasse PluginHtm
35 : *
36 : * @package eStudy.Suchmaschine
37 : * @version 0.1 01/08/08
38 : * @author Jörg Rieger
39 : */
40 :
41 1 : class PluginHtm extends Indexer {
42 : /**
43 : * Kontruktor
44 : *
45 : * @access public
46 : */
47 : public function __construct() {
48 0 : $this->name = 'HTM';
49 :
50 0 : $this->fileExt = array(
51 0 : "txt",
52 0 : "html",
53 0 : "htm",
54 : "xml"
55 : //"doc" // MS-Word-Datei
56 0 : );
57 0 : }
58 :
59 : /**
60 : * Öffnen der Datei
61 : *
62 : * @access public
63 : */
64 : public function open( $fileName ) {
65 0 : if ( !file_exists($fileName) )
66 0 : throw new Exception('Datei ' . $fileName . ' existiert nicht');
67 :
68 0 : $this->file = file($fileName);
69 0 : }
70 :
71 : /**
72 : * Zurückgeben des Inhalts
73 : *
74 : * @access public
75 : */
76 : public function getContent() {
77 0 : return @implode("", $this->file);
78 : }
79 :
80 : /**
81 : * Schliessen der Datei
82 : *
83 : * @access public
84 : */
85 : public function close() {
86 0 : }
87 :
88 : /**
89 : * Temporäre Dateien entfernen
90 : *
91 : * @access public
92 : */
93 : public function cleanup() {
94 0 : }
95 :
96 : }
|